{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
<link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript">
$(function() {
$('th[type="order"]').click(function() {
var order = $(this).attr('field') + '-' + $(this).attr('order');
$('#order').val(order);
$('input[name="search"]').click();
}).css({'cursor': 'pointer', 'color': '#36c'});
var order = $('#order').val().split('-');
var field = $('th[type="order"][field="' + order[0] + '"]');
if (order[1] == 'ASC') {
field.attr('order', 'DESC').text(field.text() + '↑');
} else {
field.attr('order', 'ASC').text(field.text() + '↓');
}
if (order[0] != 'arrival_date') {
$('th[type="order"][field="arrival_date"]').attr('order', 'DESC');
}

$("#fabric_shop_id").change(function(){
var brand_id = $(this).val();
var url="index.php?app=sample&act=ajax_get_fabric_shop&id="+brand_id;

$.getJSON(url,function(ret){
	if(ret)
	{
		$("#factory_item option").remove();
		$("#factory_item").append('<option value=""></option>');
			$.each(ret, function(k, v) {
			$("#factory_item").append('<option value="'+v+'" >'+v+'</option>');
			});
	}
  });
  });
  
  
});

</script>
</head>
<body>
<div class="sub-body">
	<div id="head">
		<form action="index.php" method="get">
			<table width="60%" cellspacing="0" cellpadding="0" class="search">
				<tbody>
					<tr>
						<th width="120">订单号：</th>
						<td width="200"><input type="text" id="order_sn" name="order_sn" class="input-1" /></td>
						<th width="100">款号：</th>
						<td width="200"><input type="text" id="style_sn" name="style_sn" class="input-1" /></td>
						<td width="100" rowspan="2">
							<input type="hidden" name="app" value="order" />
							<input type="hidden" name="act" value="status" />
							<input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}product_date-DESC{/if}" />
							<input type="submit" value="查询" class="inquiry"  name="search"/></td>
					</tr>
					<tr>
						<th>工厂：</th>
						<td><select name="factory_id" id="factory_id">
					{if $user.role eq USER_FACTORY}
						<option value="{$user.factory_id}">{$user.factory_name}</option>
					{else}
						<option value="0"></option>
						<!--{foreach from=$factory_list item=factory}-->
						<option value="{$factory.factory_id}">{$factory.factory_name}</option>
						<!--{/foreach}-->
					{/if}
						</select></td>
						<th>生产板状态：</th>
						<td><select name="product_status" id="product_status">
								<option value="-1"></option>
								<!--{foreach from=$lang.pro_status item=ps key=p}-->
								<!-- {if $user.role==USER_FACTORY} -->
								{if in_array($p,array(1))}
								<option value="{$p}" {if $p == $smarty.get.product_status}selected{/if}>{$ps}</option>
								{/if}
								<!-- {else} -->
								<option value="{$p}" {if $p == $smarty.get.product_status}selected{/if}>{$ps}</option>
								<!-- {/if} -->
								<!--{/foreach}-->
							</select></td>
					</tr>
				</tbody>
			</table>
		</form>
		<script>
<!--{if $role==USER_MERCHANDISER}-->
//$('#brand_id').attr('disabled','true');
$('#merchandiser_id option:first-child').remove();
$('#merchandiser_id').val('{$user.user_id}');
$('#merchandiser_id').attr('readonly','readonly');
<!--{/if}-->
</script> 
	</div>
	<div class="tab_info">
		<div class="tab-title-1"><span>订单查询列表</span></div>
		<table width="100%" cellspacing="0" cellpadding="0" id="tab-color2" class="tab-display">
			<tbody>
				<tr>
					<th width="3%">序号</th>
					<th width="7%" type="order" field="order_create_date" order="ASC">下单日期</th>
					<th width="9%" type="order" field="order_sn" order="ASC">订单号</th>
					<th width="7%"  type="order" field="style_sn" order="ASC">款号</th>
					<th width="7%" type="order" field="brand_name" order="ASC">品牌</th>
					<th width="7%" type="order" field="buyer_name" order="ASC">买手</th>
					<th width="7%" type="order" field="merchandiser" order="ASC">跟单</th>
					<th width="7%">图片</th>
					<th width="7%" type="order" field="factory_name" order="ASC">工厂</th>
					<th width="7%" type="order" field="release_date" order="ASC">工厂入仓日期</th>
					<th width="7%" type="order" field="product_date" order="ASC">安排样板日期</th>
					<th width="7%">板期</th>
                    <th width="6%" type="order" field="status" order="ASC">生产板状态</th>
				</tr>
				<!--{foreach from=$orders item=order name=o}-->
				<tr style="height: 80px">
					<td>{$smarty.foreach.o.iteration}</td>
					<td>{$order.order_create_date|date}</td>
					<td><a href="{url app=order&act=edit&id=$order.order_id}"  style="color:blue">{$order.order_sn|default:-}</a></td>
					<td>{$order.style_sn}</td>
					<td>{$order.brand_name}</td>
					<td>{$order.buyer_name}</td>
					<td>{$order.merchandiser}</td>
					<td><a href="{$site_url}/{$order.front_pic}" target="_blank"><img src="{$order.front_pic}" width="80" style="border:none;" alt="图片"/></a></td>
					<td>{$order.factory_name}</td>
					<td>{$order.release_date|date}</td>
					<td>{$order.product_date|date}</td>
					<td>{$order.product_day}</td>
                    <td>{$lang.pro_status.$order.product_status}</td>
				</tr>
				<!--{/foreach}-->
			</tbody>
		</table>
	</div>
	<div class="page"> {include file=page.html} </div>
</div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script> 
<script language="JavaScript">
$(function(){
//$('table.tab-add  tr:nth-child(odd)').css('backgroundColor',"#f4f8fa");
});
<!--{if $search}-->
$(function(){
var get_para={$get_para};
$.each(get_para,function(k,v){
if($('#'+k)){
$('#'+k).attr('value', v);
}
})
});
<!--{/if}-->
</script>
</body>
{$async_sendmail}
</html>
